<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    

    <script src="./js/bj_wechat.js"></script>
    <!-- vconsole -->
    <script src="./js/vconsole.min.js"></script>

    <script>
        
        // http://c14.bluej.cn/ken/wechat-jssdk/wxlogin.html?openid=ovjdzuMuMG3laD6G5TIaIRPj4sPg
        if(!OPENID){

            // 跳转到登录授权界面并且重定向到本页面
            location.href = API.LOGIN;
        }else{
            // 请求用户信息，根据用户的openid获取
            Utils.get( API.GET_USER,{
                openid:OPENID
            },function(res){
                res = JSON.parse(res);
                console.log(res);
                localStorage.setItem("headimgurl") = res.data.headimgurl;
                localStorage.setItem("username") = res.data.username;
                localStorage.setItem("sex") = res.data.sex;

            } )

        }
        



    
    
    </script>



</body>
</html>